<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

//微信共享授权
Route::get('wechat-oauth', 'WechatOauthController@index');

// 登记
Route::group([
    'prefix' => 'punch/card',
    'middleware' => ['changgeng.wechat.oauth:snsapi_userinfo']
], function () {
    Route::get('index', 'PunchCardController@index')->name('punch.card.index'); //首页
    Route::post('punch', 'PunchCardController@punch')->name('punch.card'); // 登记
    Route::get('list', 'PunchCardController@list')->name('punch.card.list');
    Route::get('getData', 'PunchCardController@getData')->name('punch.card.getData');
    Route::get('yuyue', 'PunchCardController@yuyue')->name('punch.card.yuyue'); // 预约通知

    Route::get('remark/{record}', 'PunchCardController@adminRemark')->name('punch.card.remark'); // 手机端备注
    Route::get('open_a_card/{user}', 'PunchCardController@adminOpenACard')->name('punch.card.open.card'); // 手机开卡
    Route::post('subremark', 'PunchCardController@subremark')->name('punch.card.subremark'); // 手机端备注
    Route::get('look', 'PunchCardController@look')->name('punch.card.look'); // 手机端查看
    Route::get('lookList', 'PunchCardController@lookList')->name('punch.card.lookList'); // 手机端查看
    Route::get('add/{user}', 'PunchCardController@add')->name('punch.card.add'); // 手机端添加记录
    Route::post('mobileSub', 'PunchCardController@mobileSub')->name('punch.card.mobileSub'); // 手机端备注
});
